﻿Namespace Global.Runa.UI.Threading

    Public NotInheritable Class DispatcherUnhandledExceptionFilterEventArgs
        Inherits DispatcherEventArgs

        Private _exception As Exception
        Private _requestCatch As Boolean

        Friend Sub New(ByVal dispatcher As Dispatcher)
            MyBase.New(dispatcher)
        End Sub

        Friend Sub Initialize(ByVal exception As Exception, ByVal requestCatch As Boolean)
            Me._exception = exception
            Me._requestCatch = requestCatch
        End Sub

        Public ReadOnly Property Exception As Exception
            Get
                Return Me._exception
            End Get
        End Property

        Public Property RequestCatch As Boolean
            Get
                Return Me._requestCatch
            End Get
            Set(ByVal value As Boolean)
                If Not value Then
                    Me._requestCatch = value
                End If
            End Set
        End Property

    End Class

    Public Delegate Sub DispatcherUnhandledExceptionFilterEventHandler(ByVal sender As Object, ByVal e As DispatcherUnhandledExceptionFilterEventArgs)

End Namespace